#include <iostream>
#include <string>

#include "search.hpp"
#include "log.hpp"

Log server_log;

const std::string raw_file = "./data/raw_html/raw.bin";

int main()
{
    qyc::search_html* search = new qyc::search_html;
    search->init_search(raw_file);
    std::string query;
    while (true)
    {
        std::string json_string;
        std::cout << "please enter you search query: ";
        std::getline(std::cin, query);
#ifdef __TEST__DEBUG__1
        std::cout << "用户输入: " << query << std::endl;
        sleep(1);
#endif
        search->search(query, json_string);
        std::cout << "search result:" << std::endl;
        std::cout << json_string << std::endl;
    }
    return 0;
}